/*
 * Peralta Santa Anna Victor Miguel
 * Diciembre 2011
 * Stored Procedure:
 *
 * Borramos un correo
 */

CREATE OR REPLACE FUNCTION deleteCorreo
	(
		nidcorreo1 			INTEGER
		
	) RETURNS INTEGER AS $$
	
	BEGIN
	
		DELETE FROM CORREOS 
		
		WHERE nidcorreo = nidcorreo1;
		
		RETURN 1;
		
		COMMIT;
		
	END;
	
$$ LANGUAGE plpgsql;

--select deleteCorreo( 1 );

